package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.User;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * C端-用户相关数据层
 * @author wzplove
 */
@Mapper
public interface UserMapper {

    //根据openid查询用户
    User getByOpenid(String openid);

    //创建新微信用户
//    @AutoFill(value = OperationType.INSERT)
    void insert(User user);

    //根据id查询用户
    @Select("select * from user where id = #{id}")
    User getById(Long userId);

    //根据动态条件统计用户数量
    Integer countByMap(Map map);
}
